BoundedRecord

Operations over values that carry their permitted range.

Fields

NameTypeDescription
clampBounded.clamp bounds valueRestricts a value into the bounds.
createBounded.create bounds valueAdmits a value only when it already lies within the bounds.
refinementBounded.refinement boundsReturns a refinement admitting values within the supplied bounds.
valueBounded.value inputReturns the underlying value.
boundsBounded.bounds inputReturns the interval the value is constrained to.
isAtBoundBounded.isAtBound inputReturns whether the value sits on either bound.
mapBounded.map mapping inputApplies a mapping and re-clamps into the same bounds, so the invariant survives a mapping that would otherwise leave the range.
withBoundsBounded.withBounds newBounds inputMoves a value into different bounds, clamping as needed.
Boundsthis.BoundsReturns the interval the value is constrained to.
Valuethis.ValueReturns the underlying value, which always lies within the bounds.
BoundedValueBoundedValueNo description available.
BoundsValueBoundsValueNo description available.